/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.shop.service;

import java.util.List;

import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.shop.entity.BusinessProduct;
import com.thinkgem.jeesite.modules.shop.dao.BusinessProductDao;

/**
 * 商品信息Service
 * @author 开发者
 * @version 2016-07-10
 */
@Service
@Transactional(readOnly = true)
public class BusinessProductService extends CrudService<BusinessProductDao, BusinessProduct> {

	public BusinessProduct get(String id) {
		return super.get(id);
	}
	
	public List<BusinessProduct> findList(BusinessProduct businessProduct) {
		return super.findList(businessProduct);
	}
	
	public Page<BusinessProduct> findPage(Page<BusinessProduct> page, BusinessProduct businessProduct) {
		return super.findPage(page, businessProduct);
	}
	
	@Transactional(readOnly = false)
	public void save(BusinessProduct businessProduct) {
        if(businessProduct.getIntroduce() != null){
            businessProduct.setIntroduce((StringEscapeUtils.unescapeHtml4(businessProduct.getIntroduce())));
        }
		super.save(businessProduct);
	}
	
	@Transactional(readOnly = false)
	public void delete(BusinessProduct businessProduct) {
		super.delete(businessProduct);
	}
	
}